﻿namespace FuckSp
{


    /*
     SP 虚拟栈分析 
    
| ---------- | ------------------------------------------- | -------------------------------- |
|            |    pop dword ptr ds:[edi+74]                |  mov [B+74], 0                   | 
|            |    pop dword ptr ds:[edi+80]                |  mov [B+80], 0                   | 
|            |                                             |                                  | 
|            |                                             |                                  | 
| ---------- | ------------------------------------------- | -------------------------------- |
|            |    push dword ptr ss:[ebp]                  |                                  |  ...
|            |    add ebp,10                               |   ebp -> origin esp              |   .
| ---------- | ------------------------------------------- | -------------------------------- |   .
|            |    mov ecx,8                                |   esi -> B top                   |   .
|            |    rep movsd                                |   edi -> A top                   |   虚
|            |    sub edi,20                               |                                  |   拟
|            |                                             |                                  |   栈
| ---------- | ------------------------------------------- | -------------------------------- |   分
|    C       |    lea esp,dword ptr ss:[esp-14C]           |  19F5F8                          |   配
|  width=14C |                                             |                                  |   代
| ---------- | ------------------------------------------- | -------------------------------- |   码
|    B       |    mov ebp,esp                              |  19F744                          |   .
| width=800  |    lea esp,dword ptr ss:[esp-800]           |                                  |   .
|            |    mov edi,esp                              |                                  |  ...
| ---------- | ------------------------------------------- | -------------------------------- |
|    A       |    push FD137D48                            |  19FF44                          | 
|  width=30  |    push 0                                   |                                  | 
|            |    push ry.42E68E6                          |                                  | 
|            |    pushfd                                   |                                  | 
|            |    push esi                                 |                                  | 
|            |    push eax                                 |                                  | 
|            |    push ebx                                 |                                  | 
|            |    push ecx                                 |                                  | 
|            |    push edx                                 |                                  | 
|            |    push edi                                 |                                  | 
|            |    push ebp                                 |                                  | 
|            |    push esp                                 |                                  | 
|            |    mov ebx,0                                |                                  | 
|            |                                             |                                  | 
| ---------- | ------------------------------------------- | -------------------------------- |
| origin esp |                                             |    19FF74                        | 
| ---------- | ------------------------------------------- | -------------------------------- |


     */


    /// <summary>
    ///  针对 sp 的专门化简
    /// </summary>
    internal class SpOptimizer
    {


    }
}
